mui.init()
var my_phone = localStorage.getItem("my_phone");
var user_id = localStorage.getItem("user_id");
var self;
var title;
var partition_type;
var gift_id;
window.onload = function() {
	mui.plusReady(function() {
		self = plus.webview.currentWebview();
		gift_id = self.gift_id;
		partition_type = self.partition_type;
		title = self.title;
	})
}
$(document).on('tap', '#agreed', function() {
	mui.ajax(user_url + '/api/updataProtocol', { //查询用户信息接口
		data: {
			"id": user_id,
			"sign": "string"
		},
		dataType: 'json', //服务器返回json格式数据
		type: 'post', //HTTP请求类型
		timeout: 10000, //超时时间设置为10秒；
		headers: {
			'Content-Type': 'application/json'
		},
		success: function(data) {
			if(data.code == 10000) {
				var partition_type = 4;
				mui.openWindow({
					url: 'gift_area.html',
					id: 'gift_area',
					extras: {
						gift_id: gift_id,
						partition_type: partition_type,
						title: title
					}
				});
			}
		},
		error: function(xhr, type, errorThrown) { //异常处理；
			console.log(type);
		}
	});
})